package com.xbongbong.pay.platform.wechatpay.pojo.response.partner;

import com.alibaba.fastjson.annotation.JSONField;
import com.xbongbong.pay.platform.wechatpay.pojo.response.WeChatBaseResponse;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 魏荣杰
 * @date 2021/2/8 16:48
 * @since
 * @version
 */
@Setter
@Getter
public class WeChatPayPartnerTransactionsResponse extends WeChatBaseResponse {
    private static final long serialVersionUID = -7427084164369611475L;

    /**
     * 预支付交易会话标识。用于后续接口调用中使用，该值有效期为2小时
     * 示例值：wx201410272009395522657a690389285100
     */
    @NotNull
    @Size(min = 1, max = 64)
    @JSONField(serialize = false)
    private String prepayId;

    /**
     * 时间戳，目前先用请求头里面的时间戳
     */
    @NotNull
    @Size(min = 1, max = 32)
    private String timeStamp;

    /**
     * 随机字符串
     */
    @NotNull
    @Size(min = 1, max = 32)
    private String nonceStr;

    /**
     * 签名方式
     */
    @NotNull
    @Size(min = 1, max = 32)
    private String signType;

    /**
     * 签名
     */
    @NotNull
    @Size(min = 1, max = 256)
    private String paySign;

    /**
     * 小程序id
     */
    @NotNull
    @Size(min = 1, max = 16)
    private String appId;

    @JSONField(name = "package")
    private String packages;

    public WeChatPayPartnerTransactionsResponse(@NotNull @Size(min = 1, max = 32) String timeStamp, @NotNull @Size(min = 1, max = 32) String nonceStr, @NotNull @Size(min = 1, max = 32) String signType, @NotNull @Size(min = 1, max = 256) String paySign, @NotNull @Size(min = 1, max = 16) String appId, String packages) {
        this.timeStamp = timeStamp;
        this.nonceStr = nonceStr;
        this.signType = signType;
        this.paySign = paySign;
        this.appId = appId;
        this.packages = packages;
    }

}
